package com.yao.club.reposittory;

import com.yao.club.entity.dto.GoodsShoppingCarItem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface GoodsShoppingCarItemRepository extends JpaRepository<GoodsShoppingCarItem, Long> {
    
    /**
     * 根据商品ID和SKU ID查找购物车项
     */
    GoodsShoppingCarItem findByGoodsIdAndGoodsSkuIdAndUserId(Long goodsId, Long goodsSkuId,Long userId);

    /**
     * 根据用户ID查找购物车项
     */
    List<GoodsShoppingCarItem> findByUserId(Long userId);
}
